<!--
        *前台会员中心订单详情
        * 
        *
        * @author     yuanxi
        * @version    2018-03-01 17:28   
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>订单详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/public/static/homes/css/iconfont/iconfont.css" rel="stylesheet"/>
    <link href="/public/static/homes/css/common.css" rel="stylesheet"/>
    <link href="/public/static/homes/css/uc.css" rel="stylesheet"/>
</head>
<body>
    <!--头部-->
    {:widget("Cate/header")}
    

        <div class="wrapper uc-router">
        <ul>
            <li><a href="/homeindex/index">首页</a></li>
            <li><span class="divider"></span></li>
            <li><span><a href="/myuser/myuser">会员中心</a></span></li>
            <li><span class="divider"></span></li>
            <li><span><a href="javascript:void(0)">订单详情</a></span></li>
        </ul>
    </div>

    <div class="wrapper">
        <div class="uc-main clearfix">
            {:widget("Cate/left")}
            <div class="uc-content">
                <div class="uc-panel">
                    <div class="uc-bigtit">订单详情</div>
                    <div class="uc-panel-bd">
                        <div class="order-detail">
                            <div class="od-hd">
                                <div class="fl">
                                    <span class="tit stit">订单号：</span><span id="orderid">{$orders.orderid}</span>
                                    <input type="hidden" class='time' value="{$orders['time']}">
                                </div>
                                {if condition="($orders.status eq 0)"}
                                <div class="fr">
                                    <a href="/myorder/cancel/id/{$orders.id}" class="ui-btn-low ui-btn-hollow uc-btn-md">取消订单</a>
                                    <a href="/myorder/pay/id/{$orders.id}" class="ui-btn-theme uc-btn-md">立即支付</a>
                                </div>
                                {elseif condition="($orders.status eq 1)"}
                                <div class="fr">
                                    <a href="javascript:void(0)" class="ui-btn-low ui-btn-hollow uc-btn-md">联系客服</a>
                                </div>
                                {elseif condition="($orders.status eq 2)"}
                                <div class="fr">
                                    <a href="" class="ui-btn-theme uc-btn-md">确认收货</a>
                                </div>
                                {elseif condition="($orders.status eq 3)"}
                                <div class="fr">
                                     <a href="javascript:void(0)" class="ui-btn-low ui-btn-hollow uc-btn-md">已签收</a>
                                     <a href="javascript:void(0)" class="ui-btn-theme uc-btn-md">去评价</a>
                                </div>
                                {elseif condition="($orders.status eq 4)"}
                                <div class="fr">
                                     <a href="javascript:void(0)" class="ui-btn-low ui-btn-hollow uc-btn-md">已评价完成订单</a>
                                </div>
                                {else/}
                                <div class="fr">
                                     <a href="javascript:void(0)" class="ui-btn-low ui-btn-hollow uc-btn-md">订单已取消</a>
                                </div>
                                {/if}
                            </div>
                            <div class="od-status">
                            {if condition="($orders.status eq 0)"}
                                <div class="tit"  id="box">等待付款</div><span id="ss">0</span>后订单将被关闭
                            {elseif condition="($orders.status eq 1)"}
                                <div class="tit">耐心等待商家发货或 <a href="javascript:void(0)" class="ui-btn-low ui-btn-hollow uc-btn-md">联系客服</a></div>
                            {elseif condition="($orders.status eq 2)"}
                                <div class="tit">请尽快确认收货</div>
                            {elseif condition="($orders.status eq 3)"}
                                <div class="tit">该订单已经签收<a href="" class="ui-btn-low ui-btn-hollow uc-btn-md">去评价</a></div>
                            {elseif condition="($orders.status eq 4)"}
                                <div class="tit">该订单已经评价，订单完成</div>    
                            {else/}
                                <div class="tit">该订单已经取消</div>
                            {/if}
                            </div>
                            <div class="od-percent">
                                <div class="col"><div class="inner"></div></div>
                                <div class="col col2"><div class="inner"></div></div>
                                <div class="col col3"><div class="inner"></div></div>
                                <div class="col col4"><div class="inner"></div></div>
                            </div>
                            <div class="od-pdt">
                                {foreach name="orderdetails" item="rows"}
                                <div class="item">
                                    <img src="{$rows.pic}" class="figure" />
                                    <div class="pname">{$rows.goodsname}</div>
                                    <div class="price">{$rows.price}元×{$rows.gnum}</div>
                                </div>
                                {/foreach}
                            </div>
                            <div class="od-info">
                                <div class="item">
                                    <div class="tit">
                                        收货信息<a href="/myorder/edit/id/{$orders.id}" class="ui-btn-low ui-btn-hollow uc-btn-md fr" style="display:none;">修改</a>
                                    </div>
                                    <div class="meta">
                                        <div>姓&emsp;&emsp;名：{$orders.linkname}</div>
                                        <div>联系电话：{$orders.phone}</div>
                                        <div>收货地址：{$orders.site}</div>
                                    </div>
                                </div>
                            </div>
                            <div class="od-count">
                                <div class="inner">
                                    <div class="item">
                                        <div class="tit">商品总价：</div>
                                        <div class="val">{$orders.money}元</div>
                                    </div>
                                    <div class="item last">
                                        <div class="tit">实付金额：</div>
                                        <div class="val"><span class="strong">{$orders.money}</span>元</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="/public/static/homes/js/jquery.js"></script>
<script>
    // if ($('.tit').html() == '订单提交成功，应付金额 0 元') {
    //     window.location='/homeindex/index';
    // }else{
    //订单倒计时
    //获取当前10位时间戳
    ts = Math.round(new Date().getTime()/1000).toString();
    t = +$('.time').val() + 86400 -ts;
    // alert(t);
    //声明要倒计时的秒数
    var seconds = t;//1小时 20分钟 3秒
    //调用run
    run();
    //定时器
    var timmer = setInterval(run,1000);
    //定义函数
    function run(){
        //判断  如果倒计时结束
        if(seconds <= 0){
            id = $('#orderid').val();
            $.get('/pay/delorder',{id:id},function(data){
                if(data > 0){
                        document.getElementById('box').innerHTML = '<span class="xx" style="font-size:30px">超时未支付，订单已取消! <a href="/homeindex/index" style="color:red">返回商城首页</a></span>';
                    }
            });
            
            clearInterval(timmer);
            return;
        }

        //取出倒计时秒数中的小时数
        var h = Math.floor(seconds/3600);
        //获取分钟数
        var s = seconds - h*3600;
        var m = Math.floor(s/60);
        //获取秒数
        s = s - m*60;
        //处理 时 分 秒的格式
        h = (h>9)?h:'0'+h;
        m = (m>9)?m:'0'+m;
        s = (s>9)?s:'0'+s;

        //把时 分 秒 输出到指令位置
        var timeStr = +h+'时'+m+'分'+s+'秒';
        document.getElementById('ss').innerHTML = timeStr;

        //秒数 -1
        seconds --;
    }
// }
</script>
{:widget("Cate/footer")}